package com.woniu.microuserserver.service;

import com.github.pagehelper.PageInfo;
import com.woniu.microcommonsserver.entity.RoleInfoEntity;
import com.woniu.microcommonsserver.entity.RolePermEntity;
import com.woniu.microuserserver.bean.RoleQuery;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface RoleService {
    //根据条件查询所有角色
    public PageInfo<RoleInfoEntity> searchByQuery(RoleQuery roleQuery);
    //修改角色信息
    public int updateRole(RoleInfoEntity roleInfoEntity);
    //添加角色
    public int addRole(RoleInfoEntity roleInfoEntity);
    //根据角色主键判断是否绑定用户
    public int checkUidByrid(int rid);
    //删除角色
    public int delRole(int rid);
    //根据id修改角色状态
    public int updateRoleStatus(RoleInfoEntity roleInfoEntity);
    //给角色添加用户
    public int addUserToRole(int rid,int uid);
    //查询这个角色已经拥有的用户id
    public List<Integer> findTheRoleHasUser(int rid);
    //移除一名角色的绑定用户
    public int removeUserFromRole(int rid);
    //添加权限数据
    public int addPermToRole(int rid,int hp,int wp,int bp,int up);
    //删除某个角色的权限
    public int delPermByRid(int rid);
    //返回某个角色拥有的权限
    public RolePermEntity getPermsByRid(int rid);
}
